import request from '@/utils/request'

// 查询车辆列表列表
export function listBasic(query) {
  return request({
    url: '/car/basic/list',
    method: 'get',
    params: query
  })
}

/* 车辆 */
export function carBasicList(query) {
  return request({
    url: '/car/basic/basicList',
    method: 'get',
    params: query
  })
}
/* 车辆 */
export function getCanDolist(query) {
  return request({
    url: '/car/basic/getCanDolist',
    method: 'get',
    params: query
  })
}

// 统计车辆列表列表
export function statistics(query) {
  return request({
    url: '/car/basic/statistics',
    method: 'get',
    params: query
  })
}
// 查询车辆列表详细
export function getBasic(id) {
  return request({
    url: '/car/basic/' + id,
    method: 'get'
  })
}
// 查询车辆列表详细
export function getInfo(id) {
  return request({
    url: '/car/basic/getInfo/' + id,
    method: 'get'
  })
}
// 获取保险管理详细信息
export function getInsuranceByCarId(id) {
  return request({
    url: '/car/basic/getInsuranceByCarId/' + id,
    method: 'get'
  })
}
// 查询上下线列表
export function listOnOff(query) {
  return request({
    url: '/car/onoff/list',
    method: 'get',
    params: query
  })
}

// 新增车辆列表
export function addBasic(data) {
  return request({
    url: '/car/basic',
    method: 'post',
    data: data
  })
}
export function tenancy(data) {
  return request({
    url: '/car/basic/tenancy',
    method: 'post',
    data: data
  })
}

// 修改车辆列表
export function updateBasic(data) {
  return request({
    url: '/car/basic',
    method: 'put',
    data: data
  })
}
//车辆整备
export function carServicing(data) {
  return request({
    url: '/car/basic/carServicing',
    method: 'put',
    data: data
  })
}
//取消车辆整备
export function cancelCarServicing(data) {
  return request({
    url: '/car/basic/cancelCarServicing',
    method: 'put',
    data: data
  })
}
// 删除车辆列表
export function delBasic(id) {
  return request({
    url: '/car/basic/' + id,
    method: 'delete'
  })
}


// 上下线车辆
// export function editRepairStatus(data) {
//   return request({
//     url: '/car/basic/editRepairStatus',
//     method: 'put',
//     data: data
//   })
// }
// 下载导入模板
export function importTemplate() {
  return request({
    url: '/car/basic/importTemplate',
    method: 'get'
  })
}
//批量车型
export function batchQueryillegal(ids) {
  return request({
    url: '/car/illegal/batchQueryillegal',
    method: 'post',
    data: {carNos:ids}
  })
}
// 识别行驶证
export function postXsz(data) {
  return request({
    url: '/car/basic/postXsz',
    method: 'get',
    params: data
  })
}
// 识别保单
export function postBxd(data) {
  return request({
    url: '/car/basic/postBxd',
    method: 'get',
    params: data
  })
}
export function exportBasic(query) {
  return request({
    url: '/car/basic/export',
    method: 'get',
    params: query
  })
}
// 查询品牌数据
export function getCarBrandList() {
  return request({
    url: '/car/basic/getCarBrandList',
    method: 'get'
  })
}

// 车辆库存列表数据查询
export function chedulingcarlist(query) {
  return request({
    url: '/shift/cheduling/car/list',
    method: 'get',
    params: query
  })
}

// 订单列表数据查询
export function chedulingorderlist(query) {
  return request({
    url: '/shift/cheduling/order/list',
    method: 'get',
    params: query
  })
}

// 车辆下线预检
export function offlinePreInspection(data) {
  return request({
    url: '/car/onoff/offlinePreInspection',
    method: 'post',
    data: data
  })
}


// 车辆下线
export function addOnoff(data) {
  return request({
    url: '/car/onoff',
    method: 'post',
    data: data
  })
}

// 车辆列表 取消下线
export function cancelByCar(data) {
  return request({
    url: '/car/onoff/cancelByCar',
    method: 'post',
    data: data
  })
}
// 车辆列表 取消调拨
export function cancelAllocation(data) {
  return request({
    url: '/car/secondment/cancelAllocation',
    method: 'post',
    data: data
  })
}

// 车辆详情 取消下线
export function cancelById(data) {
  return request({
    url: '/car/onoff/cancelById',
    method: 'post',
    data: data
  })
}
// 延迟上线
export function delayedLaunch(data) {
  return request({
    url: '/car/scheduling/delayedLaunch',
    method: 'post',
    data: data
  })
}


// 未绑定车辆设备
export function noBindList() {
  return request({
    url: '/car/information/noBindList',
    method: 'get'
  })
}

// 车辆绑定设备列表
export function carBindInformationList(carId) {
  return request({
    url: '/car/information/carBindInformationList/'+carId,
    method: 'get'
  })
}


// 车辆绑定设备列表
export function toggleCarBindInformation(data) {
  return request({
    url: '/car/information/toggleCarBindInformation',
    method: 'post',
    data:data
  })
}

// 车辆里程调整
export function updateMileage(data) {
  return request({
    url: 'car/basic/updateMileage',
    method: 'post',
    data:data
  })
}

// 油量电量查询
export function carOilQuantityt(query) {
  return request({
    url: '/car/basic/carCurrData',
    method: 'get',
    params: query
  })
}

// 发送车钥匙设备命令
export function sendCarKeysinstruction(data) {
  return request({
    url: '/car/basic/sendCarKeysinstruction',
    method: 'post',
    data:data
  })
}


